package component

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/widget"
)
// CyyList 根据传入的字符串slice data构建一个列表控件
func CyyList(data []string) *widget.List {
	return widget.NewList(func() int {
		return len(data)

	}, func() fyne.CanvasObject {
		return widget.NewLabel("i am a list")

	}, func(id int, obj fyne.CanvasObject) {
		obj.(*widget.Label).SetText(data[id])
	})
}
